package xyz.hubery.feign;

import lombok.Getter;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.hubery.domain.ExchangeTrade;
import xyz.hubery.dto.FreezeDTO;
import xyz.hubery.dto.LockUserAmountDTO;
import xyz.hubery.dto.UpdateAccountDTO;
import xyz.hubery.model.R;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(name = "finance-service",
        contextId = "AccountServiceFeign",
        configuration = ClientCredentialsFeignInterceptor.class, // 替换为使用服务内部凭证
        path = "/account")
public interface AccountServiceFeign {

    /**
     * 冻结资金
     * @param dto
     */
    @PostMapping("/lockUserAmount")
    R lockUserAmount(@RequestBody LockUserAmountDTO dto);

    /**
     * 解冻资金
     */
    @PostMapping("/unFreeze")
    R unFreeze(@RequestBody FreezeDTO freezeDTO);

    /**
     * 更新账户余额
     *
     * @param accountDTO
     */
    @PostMapping("/updateAccount")
    R updateAccountByExchangeTrade(@RequestBody UpdateAccountDTO accountDTO);


}
